<fieldset>
	<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" name="ajouter_file">
		<legend>Ajouter un client dans la file</legend>
			<table>
				<tr>
					<td><label>Telephone: </label></td>
					<td><input type="text" size="15" name="reservation_telephone"></td>
				</tr>
				<tr>
					<td><label>Nombre de personnes: </label></td>
					<td><input type="text" size="10" name="reservation_nbpersonnes"></td>
				</tr>
			</table>
			<input type="hidden" name="verifica_envio_ajouter_file" value="1" />
			<input type="submit" id="button"  name="ajouter_file" value="Ajouter" />		
	</form>
</fieldset>

<?
	if(array_key_exists("verifica_envio_ajouter_file",$_POST)){
		
			$USERID = $_POST['reservation_userid'];
			$RESTID = $_POST['reservation_restaurantid'];
			$TEL = $_POST['reservation_telephone'];
			$NBPERS = $_POST['reservation_nbpersonnes'];
			$STATUS = $_POST['reservation_status'];
			$CHECKINTIME = date(" Y-m-d H:i:s");
			if($TEL[0] == '0'){
					$TEL[0] = 3;
					$TEL = '+3'.$TEL;
			}
			$insert="INSERT INTO reservation
						SET
							reservation_checkintime='$CHECKINTIME',
							reservation_status='$STATUS',
							reservation_calltime= 0,
							reservation_userid='$USERID',
							reservation_clienttel='$TEL',
							reservation_restaurantid='$RESTID',
							reservation_nbpersonnes='$NBPERS'";
					
				if($resultado = mysql_query($insert,$conexao)) {
					echo "Sucess!\n";
				}
				else{
					echo "Erreur\n";					
				}
	}
?>